<%@page import="javax.xml.soap.Detail"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%
         request.setCharacterEncoding("UTF-8");
%>
<%@ page import="java.sql.*" %>

<html>
<head>
  		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <title>person</title>
		  <style type="text/css">
                       body{
                           background-image: url('photo/delete2.jpg');
                           background-size:cover;  
                         }
                    </style>
</head>
<body scroll = no>
            <style>
                .test {
                 font-size: 30px;
                 text-align: center;
                
                  font-family : 微软雅黑,宋体, 'New York';
                }
                </style >

</br></br></br>
<table border=3  align="center">
 <p align="center" class="test">个人信息</p>
</table>

<%
Statement sql;
Connection con;
ResultSet rs;
String name = new String();
name = (String)session.getAttribute("username");
 
String n=null;
String s=null;
String a=null;
String b=null;
String t=null;
String m=null;

   try{
       Class.forName("com.mysql.jdbc.Driver");
       }
       catch(Exception e){
    	   out.print("驱动失败");
       };
       
       
    	try{ 
    
     		 String uri="jdbc:mysql://localhost:3306/sharing";
          
 	   	 con = DriverManager.getConnection(uri,"root","ZHUBI123.");
		 String condition="select * from student where username = '"+ name +"'";

   	   sql=con.createStatement();
    	   rs=sql.executeQuery(condition);
	   while(rs.next())
    	   { 	
		n=rs.getString(2);
		s=rs.getString(4);
		a=rs.getString(6);
		b=rs.getString(6);
		t=rs.getString(7);
		m=rs.getString(8);
	      	
		out.print("<center><font color=black size=5>\t 姓名:</font><font color=black size=5>"+n+"</font>");
		out.print("</br>");
		out.print("</br>");
		out.print("<center><font color=black size=5>\t 性别:</font><font color=black size=5>"+s+"</font>");
		out.print("</br>");
                out.print("</br>");
		out.print("<center><font color=black size=5>\t 年龄:</font><font color=black size=5>"+a+"</font>");
		out.print("</br>");
                out.print("</br>");
		out.print("<center><font color=black size=5>\t 生日:</font><font color=black size=5>"+b+"</font>");
		out.print("</br>");
                out.print("</br>");
		out.print("<center><font color=black size=5>\t 电话:</font><font color=black size=5>"+t+"</font>");
		out.print("</br>");
                out.print("</br>");
		out.print("<center><font color=black size=5>\t 邮箱:</font><font color=black size=5>"+m+"</font>");

			



             }
	}
	    	catch(Exception e){
    		out.print("发生错误");
    	}
     %>






 </body></html>
